function sum(m, n) {
  if (m === n) {
    return m;
  }
  return n + sum(m, n - 1);
}

console.log(sum(1, 100));
